package cn.gson.springboot.model.mapper.cusmapper;

import cn.gson.springboot.model.pjos.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.sql.Timestamp;
import java.util.List;

@Repository
@Transactional
public interface CustomerMapper {
//    分页查询我的客户
    public List<Customer> pageSelect(@Param("empId")Integer empId,@Param("deptId")Integer deptId,@Param("cusState")Integer cusState,@Param("cupMaster")Integer cupMaster,@Param("cusName") String cusName, @Param("typeId") Integer typeId);

//    查询我关注的客户
    public List<Customer> selectAttention(@Param("empId")Integer empId,@Param("deptId")Integer deptId,@Param("cusState")Integer cusState,@Param("cupMaster")Integer cupMaster,@Param("attention")Integer attention,@Param("cusName") String cusName, @Param("typeId") Integer typeId);

//    选择客户时有效客户
    public List<Customer> haveType(@Param("typeId")Integer typeId,@Param("cupMaster")Integer cupMaster,@Param("cusName") String cusName);

//    查询客户类型
    public List<CustomerType> selectCusType();

//    查询销售部员工
    public List<Emp> allEmp(@Param("psetId")Integer psetId,@Param("meId")Integer meId,@Param("empDelete")Integer empDelete,@Param("empName") String empName);

//    根据员工姓名查询员工对象
    public Emp selectEmpNew(String empName);

//    删除客户
    public void cusDel(@Param("typeId")Integer typeId,@Param("customId") Integer customId);

//    修改客户负责人
    public void updateEmp(@Param("employeesId") Integer employeesId,@Param("customId") Integer customId);

//    查询客户姓名
    public List<Customer> selectCusName(String cusName);

//    查询全部视图
    public List<Timeline> view(Integer customId);

//    根据客户id查询客户商机
    public List<BusinessInfo> selectBusiness(@Param("status")Integer status,@Param("customId")Integer customId);

//    根据客户id查询客户合同
    public List<Contract> selectContract(@Param("contractState")Integer contractState,@Param("customId") Integer customId);

//    根据客户id查询订单
    public List<OrderInfo> selectOrderInfo(Integer customId);

//    根据客户ID查询回款
    public List<OrderInfo> selectCtschems(@Param("ctState")Integer ctState,@Param("customId") Integer customId);

//    根据客户id查询客户关怀
    public List<CustomerCare> selectCustomerCare(@Param("careDelete")Integer careDelete,@Param("customId") Integer customId);

//    根据客户ID查询交付记录
    public List<Deliverydetails> selectDeleveryDetails(@Param("prState")Integer prState,@Param("customId") Integer customId);

//    根据客户ID查询维修单
    public List<Maintain> selectMaintain(@Param("tainDelete")Integer tainDelete,@Param("customId") Integer customId);

//    根据客户id查询首要联系人
    public List<Culinkman> selectLinkman(@Param("cupState")Integer cupState,@Param("customId") Integer customId);

    //    修改首要联系人
//    public void updateMaster(@Param("cupMaster")Integer cupMaster,@Param("customID") Integer customId);

//    根据客户ID查询客户、联系人
    public Customer customerLinkman(@Param("cusState")Integer cusState,@Param("cupMaster")Integer cupMaster,@Param("customId")Integer customId);

//    根据客户id查询客户地址
    public List<Receivingcontact> kehuAddress(@Param("rcState")Integer rcState,@Param("cusId") Integer cusId);

//    查询合并记录
    public List<MergeRecord> selectMerge(@Param("startTime") String startTime,@Param("endTime")String endTime);

}
